/*****************************************************
 * Date: 2025-5-26
 * Time: 20:05
 * Author: Jonah
 * **************************************************/
#ifndef HEY_H
#define KEY_H

#include "main.h"

//下面的方式是通过直接操作HAL库函数方式读取IO
#define KEY0        HAL_GPIO_ReadPin(KEY0_GPIO_Port,KEY0_Pin)  //KEY0按键PE4
#define KEY1        HAL_GPIO_ReadPin(KEY1_GPIO_Port,KEY1_Pin)  //KEY1按键PE3
#define KEY2        HAL_GPIO_ReadPin(KEY2_GPIO_Port,KEY2_Pin) 	//KEY2按键PE2
// #define WK_UP       HAL_GPIO_ReadPin(KEY_UP_GPIO_Port,KEY_UP_Pin)  //WKUP按键PA0

#define KEY0_PRES 	1
#define KEY1_PRES	2
#define KEY2_PRES	3
// #define WKUP_PRES   4

#define CONTINUE_PRESS     (uint8_t)1
#define NOT_CONTINUE_PRESS (uint8_t)0

#define IS_KEY_CONTINUOUS_MODE(MODE) (((MODE) == CONTINUE_PRESS) || ((MODE) == NOT_CONTINUE_PRESS))

uint8_t KEY_Scan(uint8_t mode);

#endif/*KEY_H*/
